USE [eLogitics]
GO

/****** Object:  UserDefinedFunction [dbo].[AggregateString]    Script Date: 04/20/2012 16:00:59 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[AggregateString]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[AggregateString]
GO

USE [eLogitics]
GO

/****** Object:  UserDefinedFunction [dbo].[AggregateString]    Script Date: 04/20/2012 16:00:59 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

Create FUNCTION [dbo].[AggregateString]  
(  
    @Id int  
)  
RETURNS varchar(1024)  
AS  
BEGIN  
    declare @Str varchar(1024)  
    set @Str = ''  
    select @Str = @Str + [Name] from AggregationTable  
    where [Id] = @Id  
    return @Str  
END  

GO


